import { useEffect } from "react";
import { Image } from "react-vant";
import { useNavigate } from "react-router-dom";
export default function Item(items: any) {
  const navigate = useNavigate();
  const item = items.Item;
  useEffect(() => {}, [items]);
  return (
    <div className="list-item" key={item._id}>
      <p className="mark">{item.mark}号</p>
      <Image
        src={item.avtor}
        alt=""
        fit="cover"
        height="56vw"
        className="avtor"
        lazyload
        onClick={() => {
          navigate(`/app/show/${item._id}`);
        }}
      />
      <h3>{item.name}</h3>
      <p className="named">{item.laber}</p>
      <p className="vote">{item.vote}票</p>
      <button
        onClick={() => {
          items.Change(item._id);
        }}
      >
        投票
      </button>
    </div>
  );
}
